package puntaelena.facilitylocation.hillclimbing.solver.services;

import jfuzzyprincepless.negotiation.services.IService;
import puntaelena.facilitylocation.hillclimbing.solver.agents.CityChoosesFacilityAgent;
import puntaelena.facilitylocation.hillclimbing.solver.agents.CollaboratingFacilityAgent;
import puntaelena.graphsupport.FacilitiesGraph;

public interface IHillClimbingAgentRegistry
	extends IService
{
	IHillClimbingAgentRegistry EMPTY =
		new EmptyHillClimbingAgentRegistry();

	void init(FacilitiesGraph fgraph);

	public void addCityAgent(
		CityChoosesFacilityAgent cagent
	);
	public CityChoosesFacilityAgent getCityAgent(
		int city
	);

	public void addCollFcltAgent(
		CollaboratingFacilityAgent fagent
	);
	public CollaboratingFacilityAgent getCollFcltAgent(
		int facility
	);

	public CollaboratingFacilityAgent[] getFacilityAgents();
}


class EmptyHillClimbingAgentRegistry
	implements IHillClimbingAgentRegistry
{
	private static final CollaboratingFacilityAgent[] EMPTY_ARR
		= new CollaboratingFacilityAgent[0];

	@Override
	public void init(FacilitiesGraph fgraph) {
		throw new UnsupportedOperationException();
	}

	@Override
	public void addCityAgent(CityChoosesFacilityAgent cagent) {
		throw new UnsupportedOperationException();
	}

	@Override
	public CityChoosesFacilityAgent getCityAgent(int city) {
		return null;
	}

	@Override
	public void addCollFcltAgent(CollaboratingFacilityAgent fagent) {
		throw new UnsupportedOperationException();
	}

	@Override
	public CollaboratingFacilityAgent getCollFcltAgent(int facility) {
		return null;
	}

	@Override
	public CollaboratingFacilityAgent[] getFacilityAgents() {
		return EMPTY_ARR;
	}
}
